package com.gzhryc.shared_device.oem.code.agent.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Join;
import com.gzhryc.jdbc.annotaion.PrimaryKey;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.common.device.dao.db.Device;

import java.util.Date;

@Table(name = "agent_relation_device")
public class AgentRelationDevice {

    @PrimaryKey
    @Column(name = "user_id", note = "用户ID")
    protected Long userId;

    @PrimaryKey
    @Column(name = "relation_user_id", note = "关联用户ID")
    protected Long relationUserId;

    @PrimaryKey
    @Column(name = "device_sn",length = 32,notNull = true,note = "设备序列号")
    protected String deviceSn;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @Join(fromField = "device_sn",toField = "device_sn")
    protected Device device;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getRelationUserId() {
        return relationUserId;
    }

    public void setRelationUserId(Long relationUserId) {
        this.relationUserId = relationUserId;
    }

    public String getDeviceSn() {
        return deviceSn;
    }

    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Device getDevice() {
        return device;
    }

    public void setDevice(Device device) {
        this.device = device;
    }
}
